<template>


  <!-- 列表 -->
  <ContentWrap>
    <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"  @selection-change="handleSelectionChange">
      <el-table-column label="ID" align="center" prop="id" width="70"  />
      <el-table-column label="排名" align="center" prop="index" width="70"  >
        <template #default="scope">
          <span>{{scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column label="姓名" align="center" prop="nickname" width="160"  />
      <el-table-column label="回款数量" align="center" prop="count"  />
      <el-table-column label="回款金额" align="center" prop="money"  />
    </el-table>
  </ContentWrap>

</template>

<script setup lang="ts">
import { AnalysisApi } from '@/api/crm/crmanalysis'



const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化

const loading = ref(true) // 列表的加载中
const list = ref<CustomerContactsVO[]>([]) // 列表的数据
const total = ref(0) // 列表的总页数
const queryParams = reactive({
  createTime: undefined,
  name: undefined,
})
const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中
const activeIndex = ref('my')
const selectCustomers = ref([])
const isDisabled = ref(true)

/** 查询列表 */
const getList = async () => {
  isDisabled.value = true
  loading.value = true
  try {
    const data = await AnalysisApi.getReceivablesRank(queryParams)
    list.value = data
  } finally {
    loading.value = false
  }
}


/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.pageNo = 1
  getList()
}

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value.resetFields()
  handleQuery()
}

/** 初始化 **/
onMounted(() => {
  getList()
})
</script>